﻿Public Class frmPrincipal
    

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConectar.Click, Button1.Click

        For i = 0 To MiJuego.LeerUsuarios.Count - 1
            If txtUsuario.Text = MiJuego.LeerUsuarios(i).Nick AndAlso txtContraseña.Text = MiJuego.LeerUsuarios(i).Contraseña Then

                MiJuego.UsuarioActual = MiJuego.LeerUsuarios(i)
                txtContraseña.Text = ""
                txtUsuario.Text = ""
                Me.Hide()
                MDIParent1.Show()
                Exit Sub
            End If
        Next
    End Sub

   

    Private Sub frmPrincipal_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        MiJuego = New CLaseJuego
    End Sub

   
    Private Sub AñadirToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AñadirToolStripMenuItem.Click
        frmAñadirUsuario.ShowDialog()
    End Sub

    Private Sub ListaJugadoresToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListaJugadoresToolStripMenuItem.Click
        frmListaUsuarios.ShowDialog()
    End Sub

    Private Sub EliminarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EliminarToolStripMenuItem.Click
        frmBorrarUsuario.ShowDialog()
    End Sub

    Private Sub SalirToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SalirToolStripMenuItem.Click
        Me.Close()
    End Sub
End Class